{% extends 'layouts/auth_base.html' %}

{% block title %} Log in {% endblock title %}

{% block bodyclass %} login-page {% endblock bodyclass %}

{% block content %}
<div class="login-box">
  <div class="login-logo">
    <a href="/"><b>Admin</b>LTE</a>
  </div>
  <!-- /.login-logo -->
  <div class="card">
    <div class="card-body login-card-body">
      <p class="login-box-msg">Sign in to start your session</p>

      <form method="post">
        {% csrf_token %}

        {% if form.non_field_errors %}
          {% for error in form.non_field_errors  %}
            <small class="text-danger mb-3">{{ error }}</small>
          {% endfor %}
        {% endif %}

        {% for field in form %}
        <div class="input-group mb-3">
          {{field}}
          <div class="input-group-append">
            <div class="input-group-text">
              <span class="fas {% if field.name == 'username' %} fa-user {% else %}  fa-lock {% endif %}"></span>
            </div>
          </div>
        </div>
        <small class="text-danger">{{ field.errors }}</small>
        {% endfor %}
        <div class="row">
          <div class="col-8">
            <div class="icheck-primary">
              <input type="checkbox" id="remember">
              <label for="remember">
                Remember Me
              </label>
            </div>
          </div>
          <!-- /.col -->
          <div class="col-4">
            <button type="submit" class="btn btn-primary btn-block">Sign In</button>
          </div>
          <!-- /.col -->
        </div>
      </form>

      <!--
      <div class="social-auth-links text-center mb-3">
        <p>- OR -</p>
        <a href="#" class="btn btn-block btn-primary">
          <i class="fab fa-facebook mr-2"></i> Sign in using Facebook
        </a>
        <a href="#" class="btn btn-block btn-danger">
          <i class="fab fa-google-plus mr-2"></i> Sign in using Google+
        </a>
      </div>
      -->
      <!-- /.social-auth-links -->

      <p class="mt-5 mb-2 text-center">
        <a href="{% url 'password_reset' %}">Reset Pass</a>
        &bull;
        <a href="{% url 'register' %}" class="text-center">Sign UP</a>
      </p>
    </div>
    <!-- /.login-card-body -->
  </div>
</div>

{% endblock %}
